int minSubArrayLen(int target, vector<int> &nums)
{
    int n = nums.size();
    vector<int> paritalSum(n + 1);
    partial_sum(nums.begin(), nums.end(), paritalSum.begin() + 1);
    if (paritalSum[n] < target)
    {
        // 都是正数，直接判断最大值即可
        return 0;
    }
    int minSubLen = n;
    for (int i = 0; i < n; ++i)
    {
        for (int j = min(i + minSubLen, n); j > i; --j)
        {
            if (paritalSum[j] - paritalSum[i] >= target)
            {
                minSubLen = min(minSubLen, j - i);
            }
            else
            {
                break;
            }
        }
        if (minSubLen == 1)
        {
            break;
        }
    }
    return minSubLen;
}